package lanou.autohome.my;

import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.AbsoluteSizeSpan;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;

import lanou.autohome.R;
import lanou.autohome.basetool.BaseActivity;

/**
 * Created by dllo on 16/8/30.
 */
public class ForgetActivity extends BaseActivity{

    @Override
    protected int setLayout() {
        return R.layout.activity_forget_me;
    }

    @Override
    protected void intiView() {
        EditText number = bindView(R.id.number_forget_me);
        EditText numberback = bindView(R.id.numberback_forget_me);
        //新建一个可以添加属性的文本对象
        SpannableString ss = new SpannableString("手机号");
        SpannableString sss = new SpannableString("短信验证码");
        //新建一个属性对象 , 设置文字的大小
        AbsoluteSizeSpan ass = new AbsoluteSizeSpan(12,true);
        AbsoluteSizeSpan asss = new AbsoluteSizeSpan(12 , true);
        //附加属性到文本
        ss.setSpan(ass , 0 , ss.length() , Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        sss.setSpan(asss , 0 , sss.length() , Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
        //设置hint , 一定要进行转换 , 否则属性会消失
        number.setHint(new SpannableString(ss));
        numberback.setHint(new SpannableString(sss));

        ImageView back = bindView(R.id.imageview_forget_back);
        back.setOnClickListener(this);
    }

    @Override
    protected void intiData() {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.imageview_forget_back:
                finish();
        }
    }
}
